package 适龄的朋友825;

public class Solution {
    public int numFriendRequests(int[] ages) {
        int count = 0;
        for (int i = 0; i < ages.length; i++) {
            for (int j = 0; j < ages.length; j++) {
                if(i == j) continue;
                if(ages[j] <= ages[i] * 0.5 + 7) {
                    continue;
                }
                if (ages[j] > ages[i]) {
                    continue;
                }
                if (ages[j] > 100 && ages[i] < 100) {
                    continue;
                }
                System.out.println(ages[i] + " " + ages[j]);
                count++;
            }
        }
        return count;
    }
}
